const path = require('path');
const pkg = require(path.join(process.cwd(), 'package.json'));

module.exports = {
    entry: {
        "index": path.join(process.cwd(), 'src/index.js')
    },
    output: {
        filename: '[name].js',
        path: path.join(__dirname, '../dist', pkg.version),
        publicPath: ''
    },
    plugins:[],
    devServer: {
        // inline: true,
        // quiet: false,
        // color: true,
        // contentBase: './public/',
        // historyApiFallback: true,
        // hot: true,
        // noInfo: false
    },
    resolve: {
        extensions: ['*', '.js', '.jsx'],
        alias: {

        }
    },
    module: {
        rules: [
            { test: /\.(js|jsx)$/, use: ["babel-loader"] },
            // { test: /\.css$/, use: ["style-loader", "css-loader", "postcss-loader"] },
            // { test: /\.scss$/, use: ["style-loader", "css-loader", "postcss-loader", "sass-loader"] },
            // { test: /\.less$/, use: ["style-loader", "css-loader", "postcss-loader", "less-loader"] },
            // { test: /\.(png|jpg|gif)$/, use: ["file-loader"] },
            // { test: /\.(mp3|mp4|woff|ttf|eot|svg)$/, use: ["file-loader"] },
        ]
    },
    // postcss: function () {
    //     return [
    //         require('precss'),
    //         require('autoprefixer'),
    //         require('postcss-px2rem')({ remUnit: 75 })
    //     ];
    // }
}